package net.niufei.packet;

import java.net.SocketAddress;

import net.niufei.DataBuffer;
import net.niufei.Packet;

public class DefaultPacket implements Packet {
	
	private SocketAddress address;
	private DataBuffer content;
	
	
	public DefaultPacket() {
		
	}
	
	
	public DefaultPacket(DataBuffer dataBuffer) {
		this.content = dataBuffer;
	}
	
	
	public DefaultPacket(DataBuffer dataBuffer, SocketAddress address) {
		this.content = dataBuffer;
		this.address = address;
	}
	

	@Override
	public SocketAddress getAddress() {
		return address;
	}
	
	
	public void setAddress(SocketAddress address) {
		this.address = address;
	}
	

	@Override
	public DataBuffer getContent() {
		return content;
	}
	
	
	public String toString() {
        return "Packet [content] " + content + " [address] " + address;
	}

}
